import { RouteRecordRaw } from "vue-router";
// 路由记录其实就是路由的泛型
interface RouteMeta {

}

export const allRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/home",
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: "/home",
        name: "首页",
        component: () => import("@/view/home/index.vue"),
        meta: {
          title: "菜单主页",
          icon: "House",
          roles: ['admin', 'common'],
        }
      },
      {
        path: "/members",
        name: "成员管理",
        meta: {
          title: "成员信息",
          icon: "User",
          roles: ['admin', 'common'],
        },
        children: [
          {
            path: "/members/role",
            name: "role",
            component: () => import("@/view/member/role/index.vue"),
            meta: {
              title: "成员权限管理",
              roles: ["admin"],
              icon: "Operation"
            }
          }
        ]
      },
      {
        path: "/signin",
        name: "考勤",
        component: () => import("@/view/home/index.vue"),
        meta: {
          title: "员工考勤",
          icon: "CircleCheckFilled",
          roles: ['admin', 'common'],
        }
      },
      {
        path: "/salary",
        name: "工资分发",
        component: () => import("@/view/home/index.vue"),
        meta: {
          title: "员工薪资",
          icon: "TrendCharts",
          roles: ['admin', 'common'],
        }
      },
      {
        path: "/exam",
        name: "绩效考核",
        component: () => import("@/view/home/index.vue"),
        meta: {
          title: "绩效考核",
          icon: "Finished",
          roles: ['admin', 'common'],
        }
      }, {
        path: "/teamwork",
        name: "合作",
        component: () => import("@/view/home/index.vue"),
        meta: {
          title: "赞助投资",
          icon: "Coin",
          roles: ['admin', 'common'],
        }
      },
    ]
  }
]